from django.urls import path

from apps.users.views import UsernameCountView, RegisterView, MobileCountView, LoginView, LogoutView, CenterView
from apps.users.views import EmailView, EmailVerificationView, AddAddress, AddressView, UserHistoryView

urlpatterns = [
    # 判断用户名是否重复
    # 转换器和冒号后面不要空格，最后加上斜杠
    path('usernames/<username:username>/count/', UsernameCountView.as_view()),
    path('mobiles/<mobile:mobile>/count/', MobileCountView.as_view()),
    path('register/', RegisterView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', LogoutView.as_view()),
    path('info/', CenterView.as_view()),
    path('emails/', EmailView.as_view()),
    path('emails/verification/', EmailVerificationView.as_view()),
    path('addresses/create/', AddAddress.as_view()),
    path('addresses/', AddressView.as_view()),
    path('browse_histories/', UserHistoryView.as_view()),
]